#include<bits/stdc++.h>
using namespace std;
const int MAXN=1e6+10;
int n;
int a[MAXN],b[MAXN],num[MAXN],m,vis[MAXN];
int ans;
bool cmp(int A,int B){
	return A<B;
}
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i],num[a[i]]++;
	sort(a+1,a+n+1,cmp);
	for(int i=1;i<=n;i++){
		if(!vis[a[i]]) vis[a[i]]=1,b[++m]=num[a[i]];
	}
	if(m==2){
		if(b[1]<b[2]){
			cout<<b[2]<<endl;
			return 0;
		}
		if(b[1]>=b[2]){
			cout<<(b[1]-b[2])+b[2]<<endl;
			return 0;
		}
	}
	int f=0;
	for(int i=2;i<=m;i++){
		if(b[i-1]>b[i]) f+=b[i-1]-b[i];
		if(b[i-1]<=b[i]){
			if(f>b[i]-b[i-1]) f-=b[i]-b[i-1];
			else if(f<=b[i]-b[i-1]) f=0;
		}
	}
	cout<<f+b[m]<<endl;
	return 0;
}
